import { SettingsModel } from '../../models/Settings'

export default defineEventHandler(async (event) => {
  try {
    const aboutMe = await SettingsModel.getAboutMe()
    
    if (!aboutMe || Object.keys(aboutMe).length === 0) {
      return {
        success: false,
        message: '关于我信息不存在',
        data: null
      }
    }

    return {
      success: true,
      message: '获取关于我信息成功',
      data: aboutMe
    }
  } catch (error: any) {
    console.error('获取关于我信息失败:', error)
    
    return {
      success: false,
      message: `获取关于我信息失败: ${error.message}`,
      data: null
    }
  }
})